using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace SailHero.Soft.FrameWork.Models.Mapping.AUTHCODEDBORA
{
    public class SYS_MODELMap : EntityTypeConfiguration<SYS_MODEL>
    {
        public SYS_MODELMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.MODELID)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.MODELCNAME)
                .HasMaxLength(20);

            this.Property(t => t.MODELENAME)
                .HasMaxLength(20);

            this.Property(t => t.PARENTID)
                .HasMaxLength(50);

            this.Property(t => t.URL)
                .HasMaxLength(50);

            this.Property(t => t.ISSHOW)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.CREATOR)
                .HasMaxLength(50);

            this.Property(t => t.UPDATEUSER)
                .HasMaxLength(50);

            this.Property(t => t.ORDERNUM)
                .HasMaxLength(50);

            this.Property(t => t.ID)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("SYS_MODEL", "LYHADMIN");
            this.Property(t => t.MODELID).HasColumnName("MODELID");
            this.Property(t => t.MODELCNAME).HasColumnName("MODELCNAME");
            this.Property(t => t.MODELENAME).HasColumnName("MODELENAME");
            this.Property(t => t.PARENTID).HasColumnName("PARENTID");
            this.Property(t => t.URL).HasColumnName("URL");
            this.Property(t => t.ISSHOW).HasColumnName("ISSHOW");
            this.Property(t => t.CREATOR).HasColumnName("CREATOR");
            this.Property(t => t.CREATETIME).HasColumnName("CREATETIME");
            this.Property(t => t.UPDATEUSER).HasColumnName("UPDATEUSER");
            this.Property(t => t.UPDATETIME).HasColumnName("UPDATETIME");
            this.Property(t => t.ORDERNUM).HasColumnName("ORDERNUM");
            this.Property(t => t.ID).HasColumnName("ID");
        }
    }
}
